// $Id$
// Interface of event listener class
//
// ml278
// Copyright (C) 2008 Bjørn Øivind Bjørnsen, Aleksander Gjermundsen, Knut Andre Tidemann, Thomas Hansen
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

#ifndef __EVENTLISTENER_H
#define __EVENTLISTENER_H

#include "Ogre.h"

using namespace Ogre;

namespace ml278
{
	/// types of events allowed
	enum EventType
	{
		INPUT,
		MOVEMENT,
		CALCULATION,
		RENDER,
	};
	
	// number of types in the enum
	const unsigned int NUMBER_OF_TYPES = 4;
	
	/**
	 * A baseclass to inherit when you need a way to perform operations once or twice per frame.
	 * Provides a simple set of true virtual functions which must be implemented by classes which inherit from this one.
	 * This is basically the same as the OGRE frameListener class, with minor modifications to work
	 * with a more specific event-manager (OGRE does not have strict ordering).
	*/
	class EventListener
	{
	public:
		EventListener(EventType t = CALCULATION);
		~EventListener();
		
		virtual bool frameStarted(const FrameEvent &evt) = 0;
		virtual bool frameEnded(const FrameEvent &evt) = 0;
		
		const EventType type;
	};
}

#endif //#ifndef __EVENTLISTENER_H
